/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.bussines.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vogel
 */
@Entity
@Table(name = "tips_operacion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TipsOperacion.findAll", query = "SELECT t FROM TipsOperacion t"),
    @NamedQuery(name = "TipsOperacion.findByIdTipsOperacion", query = "SELECT t FROM TipsOperacion t WHERE t.idTipsOperacion = :idTipsOperacion"),
    @NamedQuery(name = "TipsOperacion.findByFechaTips", query = "SELECT t FROM TipsOperacion t WHERE t.fechaTips = :fechaTips")})
public class TipsOperacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Tips_Operacion")
    private Integer idTipsOperacion;
    @Lob
    @Size(max = 65535)
    @Column(name = "Tips")
    private String tips;
    @Column(name = "Fecha_Tips")
    @Temporal(TemporalType.DATE)
    private Date fechaTips;
    @JoinColumn(name = "Rut_Empleado", referencedColumnName = "Rut_Empleado")
    @ManyToOne(optional = false)
    private Empleados rutEmpleado;
    @JoinColumn(name = "id_Operaciones", referencedColumnName = "id_Operaciones")
    @ManyToOne(optional = false)
    private Operaciones idOperaciones;
    @JoinColumn(name = "id_Moto", referencedColumnName = "id_Moto")
    @ManyToOne(optional = false)
    private Moto idMoto;

    public TipsOperacion() {
    }

    public TipsOperacion(Integer idTipsOperacion) {
        this.idTipsOperacion = idTipsOperacion;
    }

    public Integer getIdTipsOperacion() {
        return idTipsOperacion;
    }

    public void setIdTipsOperacion(Integer idTipsOperacion) {
        this.idTipsOperacion = idTipsOperacion;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public Date getFechaTips() {
        return fechaTips;
    }

    public void setFechaTips(Date fechaTips) {
        this.fechaTips = fechaTips;
    }

    public Empleados getRutEmpleado() {
        return rutEmpleado;
    }

    public void setRutEmpleado(Empleados rutEmpleado) {
        this.rutEmpleado = rutEmpleado;
    }

    public Operaciones getIdOperaciones() {
        return idOperaciones;
    }

    public void setIdOperaciones(Operaciones idOperaciones) {
        this.idOperaciones = idOperaciones;
    }

    public Moto getIdMoto() {
        return idMoto;
    }

    public void setIdMoto(Moto idMoto) {
        this.idMoto = idMoto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipsOperacion != null ? idTipsOperacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipsOperacion)) {
            return false;
        }
        TipsOperacion other = (TipsOperacion) object;
        if ((this.idTipsOperacion == null && other.idTipsOperacion != null) || (this.idTipsOperacion != null && !this.idTipsOperacion.equals(other.idTipsOperacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.bussines.entities.TipsOperacion[ idTipsOperacion=" + idTipsOperacion + " ]";
    }
    
}
